<script setup>
import { inject } from "vue";

// 接收数据
const money = inject('money')
const saveMoney = inject('saveMoney')
</script>

<template>
  <div class="child-page" style="padding: 50px; border: 10px solid #ccc">
    child 组件--爷爷的钱包: {{ money }} <button @click="saveMoney(1000)">存钱</button>
  </div>
</template>